﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace UtilsORM.MySqlData;

/// <summary>
/// 设备
/// </summary>
[Index("dr_complete", Name = "idxcomplete")]
[Index("dr_d_guid", Name = "idxlcuguid")]
[Index("dr_guid", Name = "idxlguid")]
[Index("dr_start_time", Name = "idxstartime")]
[Index("dr_status", Name = "idxstatus")]
public partial class iot_device_task_default_run
{
    [Key]
    public long dr_id { get; set; }

    public string dr_guid { get; set; }

    /// <summary>
    /// 设备id
    /// </summary>
    [StringLength(50)]
    public string dr_d_guid { get; set; }

    /// <summary>
    /// 0正常，1无效
    /// </summary>
    public int dr_status { get; set; }

    /// <summary>
    /// 名称
    /// </summary>
    [StringLength(50)]
    public string dr_interval_name { get; set; }

    /// <summary>
    /// 数值
    /// </summary>
    public int? dr_interval_value { get; set; }

    /// <summary>
    /// 单位ss,mm,hh
    /// </summary>
    [StringLength(5)]
    public string dr_interval_unit { get; set; }

    /// <summary>
    /// 数值ss,0为不设置值
    /// </summary>
    [Column(TypeName = "datetime")]
    public DateTime? dr_start_time { get; set; }

    /// <summary>
    /// iot_device_command
    /// </summary>
    [StringLength(255)]
    public string dr_key { get; set; }

    /// <summary>
    /// 重复0无限次，1 一次
    /// </summary>
    public int? dr_repeat_count { get; set; }

    /// <summary>
    /// 上次执行时间
    /// </summary>
    [Column(TypeName = "datetime")]
    public DateTime? dr_execute_time { get; set; }

    /// <summary>
    /// 0未执行，1已执行
    /// </summary>
    public int? dr_complete { get; set; }

    /// <summary>
    /// 已执行次数
    /// </summary>
    public int? dr_execute_count { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    [StringLength(255)]
    public string dr_title { get; set; }

    [Column(TypeName = "datetime")]
    public DateTime? dr_mod_time { get; set; }

    [Column(TypeName = "datetime")]
    public DateTime? dr_add_time { get; set; }

    /// <summary>
    ///  客户
    /// </summary>
    [StringLength(100)]
    public string dr_c_guid { get; set; }

    /// <summary>
    /// 0非模板，1模板
    /// </summary>
    public int? dr_is_template { get; set; }

    /// <summary>
    /// 产品ID
    /// </summary>
    [StringLength(50)]
    public string dr_p_guid { get; set; }

    /// <summary>
    /// 产品编号
    /// </summary>
    public int? dr_p_model_no { get; set; }

    /// <summary>
    /// 0启动，1不启动
    /// </summary>
    public int? dr_auto_run { get; set; }

    /// <summary>
    /// 0不参与自动配置，1参与自动配置
    /// </summary>
    public int? dr_auto_run_jion { get; set; }
}
